﻿<%@ Page ClassName="tintuc" Title="" Language="C#" MasterPageFile="~/master.master" AutoEventWireup="true" Inherits="System.Web.UI.Page" %>

<%@ Register TagPrefix="TourHot" TagName="TourHot" Src="control/tour/ListTourHot.ascx" %>
<%@ Register TagPrefix="LeftTour" TagName="LeftTour" Src="control/tour/LeftTourDuLich.ascx" %>
<%@ Register TagPrefix="CenterTour" TagName="CenterTour" Src="control/tour/CenterTourDuLich.ascx" %>
<%@ Register TagPrefix="RightTour" TagName="RightTour" Src="control/tour/RightTourDuLich.ascx" %>
<%@ Register TagPrefix="TopSearchTour" TagName="TopSearchTour" Src="control/common/TopSearchTour.ascx" %>
<%@ Register TagPrefix="TopSupportOnline" TagName="TopSupportOnline" Src="control/common/TopSupportOnline.ascx" %>
<%@ Register TagPrefix="TopSupportTour" TagName="TopSupportTour" Src="control/common/TopSupportTourDuLich.ascx" %>

<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {

        }
    }
    protected string LoadTinTuc()
    {
        string html = "";
        string checktour = "NULL";
        string sql = "select * from dev_news where checktour=0 and vemaybay=0 and status=1";
        System.Data.DataTable dt = new System.Data.DataTable();
        dt = DataAccess.ExeSQLToDataTable(sql);
        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                html += "<input type='hidden' id='totalrow' value='" + dt.Rows.Count + @"'>";
                html += " <div class='all_tintuc'><div class='bor_tintuc'>";
                html += "  <img  ID='imgtintuc' class='img_tintuc' Align='Left' src='files_upload/images/news/" + dt.Rows[i]["picture"] + "'/>";
                html += " <a href='chitiettin.aspx?idnews=" + dt.Rows[i]["idnews"] + "'> <h4>" + dt.Rows[i]["title"].ToString() + "</h4></a> <p>" + dt.Rows[i]["sapo"].ToString() + "</p>";
                html += "</div>";
                html += "</div>";
            }
        }
        return html;
    }
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            var totalrow = $("#totalrow").val();
            $('#black').smartpaginator({ totalrecords: totalrow, recordsperpage: 10, datacontainer: 'divs', dataelement: '.all_tintuc', initval: 0, next: 'Next', prev: 'Prev', first: 'First', last: 'Last', theme: 'black' });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="div_list_tour_hot">
        <TourHot:TourHot runat="server" ID="TourHot" />
    </div>
    <div class="div_content_top_tour">
        <TopSearchTour:TopSearchTour runat="server" ID="TopSearch" />
        <TopSupportOnline:TopSupportOnline runat="server" ID="TopSupportOnline" />
        <TopSupportTour:TopSupportTour runat="server" ID="TopSupportTour" />
    </div>
    <div class="div_content_left_tour">
        <LeftTour:LeftTour ID="LeftTour" runat="server" />
    </div>
    <div class="div_content_center_tour">
        
        <div class="div_content_center_info">
            <div class="line_div_content_center_tour">
        <a>Tin tức - Du lịch lanh đại</a>
    </div>
            <div id="divs">
                <%=LoadTinTuc() %>
                <div id="black">
                </div>
            </div>
        </div>
    </div>
    <div class="div_content_rigth_tour">
        <RightTour:RightTour ID="RightTour" runat="server" />
    </div>
</asp:Content>
